package entity.rtsp;

import java.util.Map;

public class RTSPResponseEntity {
    private String version;
    private String statusCode;
    private String word;
    private Map<String, String> headers;
    private String body;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getWord() {
        return word;
    }

    public void setWord(String word) {
        this.word = word;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append(this.version + " " + this.statusCode + " " + this.word);
        sb.append("\r\n");
        for (Map.Entry<String, String> entry : this.headers.entrySet()){
            sb.append(entry.getKey() + ":" + entry.getValue());
            sb.append("\r\n");
        }
        sb.append(body);

        return sb.toString();
    }
}
